package com.atguigu.classes.preconditions;

import java.util.Scanner;

/**
 * @program: myIDEA
 * @description: if else
 * @author: Mr.zjx
 * create: 2021-07-04-22-55
 **/
public class Test09 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        int x = scanner.nextInt();
        int y;
        if (x >=3 ){
            y = 2*x + 1;
        }else if (x >=-1 && x<3){
            y = 2*x;
        }else
            y = 2*x-1;
        System.out.println(y);
    }
}
